<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%setting}}".
 *
 * @property string $code 符号
 * @property string|null $value 值
 * @property string $name 名称
 * @property string $group 分组
 * @property string $created_at 创建时间
 * @property string|null $updated_at 上次更新
 */
class Setting extends \builder\base\BaseActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%setting}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['code', 'name', 'group'], 'required'],
            [['value'], 'string'],
            [['created_at', 'updated_at'], 'safe'],
            [['code', 'group'], 'string', 'max' => 50],
            [['name'], 'string', 'max' => 255],
            [['code'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'code' => '符号',
            'value' => '值',
            'name' => '名称',
            'group' => '分组',
            'created_at' => '创建时间',
            'updated_at' => '上次更新',
        ];
    }
}
